/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __DRIVER_TEST_H__
#define __DRIVER_TEST_H__

#include "cmsis_os2.h"
#define LOG_TAG "iot_main"
#include "log.h"
#define LOG_D(fmt, ...) HILOG_DEBUG(HILOG_MODULE_APP, fmt, ##__VA_ARGS__)
#define LOG_W(fmt, ...) HILOG_WARN(HILOG_MODULE_APP, fmt, ##__VA_ARGS__)
#define LOG_I(fmt, ...) HILOG_INFO(HILOG_MODULE_APP, fmt, ##__VA_ARGS__)
#define LOG_E(fmt, ...) HILOG_ERROR(HILOG_MODULE_APP, fmt, ##__VA_ARGS__)
#define DBG_ASSERT(cond)                                                                \
    do {                                                                                \
        if (!(cond)) {                                                                  \
            HILOG_ERROR("%s:%d '%s' assert failed.\r\n", __FILE__, __LINE__, #cond);    \
            while (1);                                                                  \
        }                                                                               \
    } while (0)

#ifdef __cplusplus
extern "C" {
#endif



#define CN_HOURS_IN_DAY         24
#define CN_MINUTES_IN_HOUR      60
#define CN_SECONDS_IN_MINUTE    60
#define CN_SECONDS_IN_HOUR      (CN_MINUTES_IN_HOUR * CN_SECONDS_IN_MINUTE)
#define CN_MINISECONDS_IN_SECOND 1000
#define CN_MINUTES_IN_DAY (CN_HOURS_IN_DAY * CN_MINUTES_IN_HOUR)
#define CN_SECONS_IN_DAY (CN_SECONDS_IN_MINUTE * CN_MINUTES_IN_DAY)
#define BASE_YEAR_OF_TIME_CALC           1900
#define CONFIG_TASK_LEVEL                20

#define    SOFTAP_NAME    "teamX-SmartHumidifier01"

#define    SID_KEY        "/data/ssid"
#define    PWD_KEY        "/data/password"

void IotMain_SetHuidityThreshold(int value);
int IotMain_GetHuidityThreshold(void);
void IotMain_JsSet(bool value);
void IotMain_CloudSet(bool value);
bool IotMain_GetMotorSts(void);

void IotMain_VoiceSet(bool value );

int  IotMainGetCurDay(void);
void IotMain_JsSetHumidityThreshold(const char *value);

// void uart_test(void);

void IotMain_StartMainThread(void);
void IotMain_SetWeather( int weather ,int temperature);
void IotMain_SetWeatherStatus(bool value);

void IotMain_StartMainThread(void);

#ifdef __cplusplus
}
#endif

#endif
